feat: Run/Debug support with optimized classpath resolution#24
Open
runchen0919 wants to merge 9 commits into
Open
feat: Run/Debug support with optimized classpath resolution#24runchen0919 wants to merge 9 commits into
runchen0919 wants to merge 9 commits into
Conversation
…g support When JavaBuilder is disabled (Bazel is the build system), the Eclipse output location is empty. This causes ClassNotFoundException at runtime because the target's own compiled JARs were computed but never serialized across the JNI boundary. Include output_jars as LIB entries in to_pipe_delimited_entries(), deduplicated against existing dependency entries to avoid duplicates from java_import targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Register a DebugConfigurationProvider that intercepts Java debug sessions and runs `bazel build` for the project's targets before the debugger starts. This ensures compiled JARs exist in bazel-bin/ so the runtime classpath (populated by Phase 1's output_jars serialization) resolves successfully. On build failure the user can choose "Debug Anyway" or cancel the launch. The build progress is shown as a cancellable notification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace aspect build with a lightweight plain `bazel build` for pre-debug target compilation. This avoids the overhead of aspect evaluation and graph updates when only compilation is needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lver Register IRuntimeClasspathEntryResolver for BAZEL_CONTAINER to bypass O(n²) computeDefaultContainerEntries() recursion. Use in-memory JavaCore.getClasspathContainer() instead of file I/O, and scope resolution to the active debug project for O(1) lookup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
For java_binary targets, gather output_jars from all transitive dependencies so the debug runtime classpath includes the full set of required jars. Small stub jars (<1KB) are filtered out. After pre-debug build, clear the runtime classpath cache and refresh the classpath container to pick up freshly built artifacts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…spath Instead of eagerly picking between full/compile JARs at graph population time, store all JAR variants (full, compile, runtime) in ResolvedJar and resolve lazily via effective_path(). This enables accurate classpath resolution for debug sessions where runtime JARs may only appear after a build. Also centralizes BazelProjectView in BazelBridge and adds build failure detection for pre-debug builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ed cache invalidation Extract setActiveDebugProject into a standalone JDT command invoked early in resolveDebugConfiguration, so the runtime classpath filter is active before the build step. Replace full cache clear with per-project clearCacheForProject for more precise invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClassNotFoundExceptionwhen Bazel is the build systemDebugConfigurationProviderthat runsbazel buildbefore debug launch, with cancellable progress notification and "Debug Anyway" fallbackbazel buildfor pre-debug compilation, avoiding aspect evaluation overheadIRuntimeClasspathEntryResolverusing in-memoryJavaCore.getClasspathContainer()instead of file I/O, optimizing debug stackTrace resolution from O(n²) to O(1)Test plan
cargo test --workspaceandmvn testto confirm no regressions🤖 Generated with Claude Code